<div id="content">
	<div class="row s_page_title">
		<sa-big-breadcrumbs [items]="['数据统计','停车点管理']" icon="fa fa-area-chart" class="col-xs-12 col-sm-7 col-md-7 col-lg-4"></sa-big-breadcrumbs>
	</div>
	<sa-widgets-grid>
		<div class="s_table">
			<div sa-widget [editbutton]="false" color="darken" class="clearfix">
				<header><span class="widget-icon"> <i class="fa fa-table"></i> </span><h2>停车点管理</h2></header>
				<div>
					<div class="widget-body no-padding">
						<div class="page-header clearfix s_table_opreation">
							<div class="left page-header-btn">
								<!-- <div class="s2_tableCar">
									<table-select-car [noCompany]="true" (outerCar)='getSelectCarInfo($event)'></table-select-car>
								</div> -->
								<sa-company-tree-car companyTreeId="companyTree" (companySelected)="companySelected($event)"></sa-company-tree-car>
								<div class="selectDate top_module">
									<table-select-date [notInit]="true" (outerTime)="getSelectTableTime($event)" ></table-select-date>
								</div>
								<button type="button" class="btn btn-primary" (click)="table_search()">查询</button>
								<!-- <button type="button" class="btn btn-primary" (click)="export_totle()">导出报表</button> -->
								<!--<button type="button" class="btn btn-primary" (click)="export_datail()">明细报表</button>-->
							</div>
							<div class="right top-search">
								<input type="text" [(ngModel)]="tableQueryitem.searchKey" (change)="table_search()" class="search-input" placeholder="车牌号码...">
								<span class="top-search-box">
							        <button class="top-search-btn" type="button" (click)="table_search()"> <i class="fa fa-search"></i></button>
							    </span>
							</div>
						</div>
						<div class="table_scroll">
							<table class="display dataTables responsive table table-striped table-bordered table-hover dataTable s_h5_table">
								<thead>
									<tr>
										<th>设备ID</th>
										<th>车牌号码</th>
										<th>公司名称</th>
										<th>开始时间</th>
										<th>结束时间</th>
										<th>停车时长</th>
										<th>停车地址</th>
										<th>操作</th>
									</tr>
								</thead>
								<tbody>
									<tr *ngFor="let row of tableData" >
										<td>{{row.deviceId}}</td>
										<td>{{row.carNumber}}</td>
										<td>{{row.companyName}}</td>
										<td>{{row.startDate}}</td>
										<td>{{row.endDate}}</td>
										<td>{{row.second}}</td>
										<td>{{row.address}}</td>
										<td>
											<button type="button" (click)="editRow(row.id,positionModal)">编辑</button>
											<button type="button" (click)="deleteRow(row)">删除</button>
										</td>
									</tr>
								</tbody>
							</table>
						</div>
						<div class="table-fix clearfix">
							<paginator [totalRecords]="totalCount"
						           [rows]="pageSize"
						           [currentPage]="curPage - 1"
						           (onPageChange)="paginate($event)">
							</paginator>
							<button type="button" class="btn default refresh_btn" (click)="refresh()"><i class="fa fa-refresh"></i></button>
						</div>
					</div>
				</div>
			</div>
		</div>
		
		<!-- 编辑弹出层 -->
		<section bsModal #positionModal="bs-modal" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel" aria-hidden="true">
			<div class="modal-dialog modal-lg">
				<div class="modal-content">
					<div class="modal-header">
						<button type="button" class="close" aria-label="Close" (click)="cancelPosition(positionModal)"><span aria-hidden="true">&times;</span></button>     
						<h4 class="modal-title">编辑</h4>
					</div>
					<div class="modal-body">
						<div class="row form-horizontal">
							<div class="col-xs-12 pageBody">
								<div class="form-horizontal">
										
										<div class="form-group s_fix_select2">
											<label class="control-label col-sm-2 no-padding-right">设备ID<sup>*</sup></label>
											<div class="col-sm-10">
												<div class="clearfix">
													<input readonly type="text" [(ngModel)]='companyData.deviceId' name="deviceId" class="form-control selecTime" id="deviceId" autocomplete="off" placeholder="选择设备ID"/>
												</div>
											</div>
										</div>
										<div class="form-group">
											<label class="control-label col-sm-2 no-padding-right">车牌号码<sup>*</sup></label>
											<div class="col-sm-10">
												<div class="clearfix">
													<input readonly type="text" [(ngModel)]='companyData.carNumber' name="carNumber" class="form-control selecTime" id="carNumber" autocomplete="off" placeholder="选择车牌号码"/>
												</div>
											</div>
										</div>
										<!-- <div class="form-group">
											<label class="control-label col-sm-2 no-padding-right">公司名称<sup>*</sup></label>
											<div class="col-sm-10">
												<div class="clearfix">
													<input type="text" [(ngModel)]='companyData.companyName' name="companyName" class="form-control selecTime" id="companyName" autocomplete="off" placeholder="公司名称"/>
												</div>
											</div>
										</div> -->
										<div class="form-group">
											<label class="control-label col-sm-2 no-padding-right">开始时间<sup>*</sup></label>
											<div class="col-sm-10">
												<div class="clearfix">
													<input type="text" [(ngModel)]='companyData.startDate' name="startDate" class="form-control selecTime" id="startDate" autocomplete="off" placeholder="开始时间"/>
												</div>
											</div>
										</div>
										<div class="form-group">
											<label class="control-label col-sm-2 no-padding-right">结束时间<sup>*</sup></label>
											<div class="col-sm-10">
												<div class="clearfix">
													<input type="text" [(ngModel)]='companyData.endDate' name="endDate" class="form-control selecTime" id="endDate" autocomplete="off" placeholder="结束时间"/>
												</div>
											</div>
										</div>
									<div style="text-align: center;">
										<button type="btn" class="btn btn-primary" (click)="save(positionModal)">保存</button>
										<button type="btn" class="btn btn-primary" (click)="cancelPosition(positionModal)">取消</button>
									</div>
								</div>
							</div>
						</div>
					</div>
				</div>
			</div>
		</section>
		
	</sa-widgets-grid>
</div>
